<?php
require_once("config.php");
require_once("CMySQL.php");

$codeClient="";
if(isset($_GET["codeClient"]))
{
	$codeClient=$_GET["codeClient"];
}

$dbName="";
if(isset($_GET["dossier"])) {
	$dbName=CMySQL::getInstance()->getDbNameFromDossier($_GET["dossier"]);
}

$aPartirDe=1;
$requete="SELECT MONTH(creation) AS aPartirDe FROM client WHERE code=\"${codeClient}\" ";

CMySQL::getInstance()->selectDb($dbName);

$result=CMySQL::getInstance()->execQuery($requete);
if(($row=mysql_fetch_array($result)))
{
	$aPartirDe=$row["aPartirDe"];
}

mysql_free_result($result);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
	<head> 
		<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
		<link rel="shortcut icon" href="favicon.ico">
		<link rel="stylesheet" type="text/css" href="css/style.css">
		<title>Evolution du client <? echo $codeClient; ?></title>
	</head>
	<body>
		<h1 align="center">Evolution du client <?php echo $codeClient; ?></h1>
		<div class='border large recap center' style='height: 229px'>
			<div class='inline bande'>
				<div class='case action fl' title='Chiffre d&apos;affaire mois/mois' onclick='document.location="caMoisMoisClient.php?codeClient=<? echo $codeClient; ?>"'>
					<img src="caMoisMoisClient.php?codeClient=<?php echo $codeClient; ?>" width="300px" height="225px" />
				</div>
					<div class='case action fl' title='Chiffre d&apos;affaire cumulé mois/mois' onclick='document.location="caMoisMoisCumuleClient.php?codeClient=<?php echo $codeClient; ?>&aPartirDe=<? echo $aPartirDe; ?>"'>
						<img src="caMoisMoisCumuleClient.php?codeClient=<?php echo $codeClient; ?>&aPartirDe=<?php echo $aPartirDe; ?>" width="300px" height="225px" />
				</div>
					<div class='case action fl' title='Chiffre d&apos;affaire sur 12 mois  glissant' onclick='document.location="caGlissantClient.php?codeClient=<? echo $codeClient; ?>"'>
						<img src="caGlissantClient.php?codeClient=<?php echo $codeClient; ?>" width="300px" height="225px" />
				</div>
			</div>
		</div>
	</body>
</html>
